from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.select import Select
import unittest,time
class jxw(unittest.TestCase):
    def setUp(self):
        self.dr=webdriver.Edge()
        self.dr.get('https://login.jiuxian.com/login.htm')
    def tearDown(self):
        time.sleep(2)
        self.dr.quit()
    def test_001(self):
        self.dr.find_element(By.ID,'userName').send_keys('15649920329')
        self.dr.find_element(By.ID,'password').send_keys('Ycy20040102')
        time.sleep(20)
        self.dr.find_element(By.XPATH,'//*[@id="save"]').click()
        time.sleep(2)
        self.dr.find_element(By.XPATH,'//*[@id="bindSub"]').click()
        time.sleep(2)
        self.dr.find_element(By.XPATH,'/html/body/div[2]/div/div[2]/ul/li[1]/div[1]/a').click()
        self.dr.switch_to.window(self.dr.window_handles[-1])
        time.sleep(5)
        # self.dr.find_element(By.XPATH,'uGuideClose').click()
        time.sleep(2)
        self.dr.find_element(By.XPATH,'/html/body/div[4]/div[1]/div[2]/div[4]/a[3]/span').click()
        time.sleep(2)
        self.dr.find_element(By.NAME,'consignee').send_keys('苗召洋')
        time.sleep(2)
        a=Select(self.dr.find_element(By.XPATH,'//*[@id="province"]'))
        a.select_by_value('2')
        time.sleep(2)
        b=Select(self.dr.find_element(By.NAME,'city'))
        b.select_by_value('52')
        time.sleep(2)
        c=Select(self.dr.find_element(By.XPATH,'//*[@id="district"]'))
        c.select_by_visible_text('昌平区')
        time.sleep(5)